package requests.info.manual;

import java.awt.Color;
import java.awt.Font;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

import main.DemiGui;
import requests.IRequest;

public class Info extends JFrame implements IRequest {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JPanel panel;
	private JScrollPane pane;
	private JLabel label;
	private ReadFromFile readFrom = new ReadFromFile();
	private String text;
	private Font font = new Font("Times New Roman", 1, 16);
	private Color color = new Color(130,130,255);
	
	public Info(int width, int heigth, DemiGui instance, String filePath) {
		setSize(width, heigth);
		setTitle("D.E.M.I. - Info");
		setFocusable(true);
		setVisible(true);
		text = readFrom.read(filePath, instance);
		text = text.substring(0, text.length()-17);
		text = "<html> " + text + " </html>";
		
		panel = new JPanel();
		panel.setBackground(color);
		
		label = new JLabel(text);
		label.setFont(font);
		label.setBackground(color);
		label.setForeground(Color.black);
		label.setOpaque(true);
		panel.add(label);
		
		add(panel);
		
		pane = new JScrollPane(panel);
		add(pane);
		
	}

	@Override
	public void returnDEMI(String text) {}

}
